import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  //引用路由 
  {
    path: '/login',
    name: 'login',
    component: () => import( '@/views/login/index')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import( '@/views/register/index')
  },
  {
    path: '/index',
    name: 'About',
    component: () => import( '@/views/index/About')
  },
  {
    path: '/marriage',
    name: 'marriage',
    component: () => import('@/views/secondPage/index')
  },
  {
    path: '/reservationQuery',
    name: 'ReservationQuery',
    component: () => import('@/views/reservationQuery/ReservationQuery')
  },
  {
    path: '/marriageDetails',
    name: 'MarriageDetails',
    component: () => import('@/views/marriageDetails/MarriageDetails')
  },
  {
    path: '/agreement',
    name: 'agreement',
    component: () => import('@/views/agreement/index')
  },
  {
    path: '/privacy',
    name: 'privacy',
    component: () => import('@/views/privacy/index')
  }
]

const router = new VueRouter({
  routes,
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})

export default router
